import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/products'
  },
  {
    path: '/products',
    name: 'ProductList',
    component: () => import('../views/product/ProductList.vue')
  },
  {
    path: '/products/add',
    name: 'ProductAdd',
    component: () => import('../views/product/ProductForm.vue')
  },
  {
    path: '/products/edit/:id',
    name: 'ProductEdit',
    component: () => import('../views/product/ProductForm.vue')
  },
  {
    path: '/orders',
    name: 'OrderList',
    component: () => import('../views/order/OrderList.vue')
  },
  {
    path: '/orders/add',
    name: 'OrderAdd',
    component: () => import('../views/order/OrderForm.vue')
  },
  {
    path: '/orders/:id',
    name: 'OrderDetail',
    component: () => import('../views/order/OrderDetail.vue')
  },
  {
    path: '/customers',
    name: 'CustomerList',
    component: () => import('../views/customer/CustomerList.vue')
  },
  {
    path: '/customers/add',
    name: 'CustomerAdd',
    component: () => import('../views/customer/CustomerForm.vue')
  },
  {
    path: '/customers/edit/:id',
    name: 'CustomerEdit',
    component: () => import('../views/customer/CustomerForm.vue')
  },
  {
    path: '/deliveries',
    name: 'DeliveryList',
    component: () => import('../views/delivery/DeliveryList.vue')
  },
  {
    path: '/deliveries/:id',
    name: 'DeliveryDetail',
    component: () => import('../views/delivery/DeliveryDetail.vue')
  },
  {
    path: '/stats',
    name: 'Statistics',
    component: () => import('../views/stats/Statistics.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router 